#!/bin/bash
# 启动 mcp 服务器

# 进入脚本所在目录
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" || exit

# 设置Python路径，确保能找到mcp包
# 获取mcp目录的父目录
PARENT_DIR="$(dirname "$(pwd)")"
# 将父目录添加到PYTHONPATH
export PYTHONPATH="$PARENT_DIR:$PYTHONPATH"
echo "PYTHONPATH设置为: $PYTHONPATH"

# 检查是否在虚拟环境中
if [ -z "$VIRTUAL_ENV" ]; then
    echo "请先激活虚拟环境"
    exit 1
fi

python server.py